/*
 * Copyright (c) 2023, LXMS (lxinet.cn).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.lxinet.lxms.system.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 用户
 *
 * @author zcx
 * @date 2023/07/08
 */
@Data
@Schema(description = "用户")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SysUserVo implements Serializable{
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户ID")
    private Long id;

    @Schema(description = "部门ID")
    private Long deptId;

    @Schema(description = "用户名")
    private String name;

    @Schema(description = "真实姓名")
    private String realName;

    @Schema(description = "邮箱")
    private String email;

    @Schema(description = "手机号码")
    private String phone;

    @Schema(description = "性别，0未知 1男 2女")
    private Integer sex;

    @Schema(description = "头像")
    private String avatar;

    @Schema(description = "状态，0停用 1正常")
    private String status;

    @Schema(description = "最后登录IP")
    private String loginIp;

    @Schema(description = "最后登录时间")
    private LocalDateTime loginTime;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "登录token")
    private String token;

    @Schema(description = "管理后台菜单")
    private List<SysMenuVo> menus;

    @Schema(description = "管理后台菜单")
    private List<String> permissions;

    @Schema(description = "岗位ID列表", example = "[1,2,3]")
    private List<Long> postIdList;

    @Schema(description = "角色ID列表", example = "[1,2,3]")
    private List<Long> roleIdList;

    public SysUserVo(){
    }

    public SysUserVo(Long id, String name, String realName, String avatar){
        this.id = id;
        this.name = name;
        this.realName = realName;
        this.avatar = avatar;
    }

}